<template>
  <!-- 商品置顶记录-->
  <div>
    <div class="topName">
      <div style="display: flex; align-items: center">
        <img
          style="width: 20px; height: 18px; margin: 0 10px"
          src="../../../assets/img/3.png"
          alt=""
          :isCollapse="true"
        />
        <el-button type="primary">商品置顶记录</el-button>
      </div>
    </div>

    <!-- 表格 -->
    <div class="main">
      <!-- 搜索 -->
      <div class="search">
        <el-input placeholder="请输入商品名称" class="inp ml10"></el-input>

        <el-button type="primary" :icon="Search" class="btn">查询</el-button>
        <el-button type="danger" class="btn mr10" style="background: #ff4848">
          删除
        </el-button>
      </div>

      <!-- 表格内容 -->
      <div class="table">
        <el-table
          ref="multipleTableRef"
          :data="tableData"
          style="width: 100%"
          @selection-change="handleSelectionChange"
          border
          stripe
          :header-cell-style="{ background: '#ECF4FF', color: '#333' }"
        >
          <el-table-column type="selection" width="44" />

          <el-table-column label="商品名称" align="center" width="440">
            <template #default="scope">{{ scope.row.date }}</template>
          </el-table-column>

          <el-table-column
            property="address"
            label="置顶时间"
            show-overflow-tooltip
            align="center"
            width="400"
          />
          <el-table-column
            property="address"
            label="状态"
            show-overflow-tooltip
            align="center"
            width="250"
          />
          <el-table-column
            property="address"
            label="存续时间"
            show-overflow-tooltip
            align="center"
          />
        </el-table>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
// icon
import { Search } from "@element-plus/icons-vue";
import { useRouter, useRoute } from "vue-router";
import "../../../assets/css/size.css";
const router = useRouter();
//表格内容
const tableData = [
  {
    date: "2016-05-03",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
];

// 全选
const multipleSelection = ref([]);

const handleSelectionChange = (val) => {
  multipleSelection.value = val;
};
</script>

<style lang="scss" scoped>
// 表格
.main {
  // width: 1610px;
  height: 760px;
  background: #ffffff;
  margin: 10px 0 0 10px;

  // 搜索
  .search {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
  }

  .table {
    margin: 0 10px;
  }
}

// 分页
.Pagination {
  margin-top: 20px;
}
</style>
